/* eslint-disable */
import { ContextSVGControl } from './ContextSVGControl'
export function NodeContextSVGControl(vm, nodeId, params) {
  let _vm = vm
  $.extend(
    this,
    {
      nodeId: nodeId,
    },
    new ContextSVGControl(params),
  )

  this.getMenuItems = function() {
    var curNode = this.getCurrentNode()
    var items = []

    if (curNode.physics == false) {
      items.push(this.addUnNockItem)
    } else {
      items.push(this.addLockItem)
    }

    items.push(this.addFocusItem)
    //		items.push(this.addRecoverItem);
    items.push(this.addLayoutItem)
    // 分析
    if (
      curNode.rels[0].represent == Represent.people &&
      curNode.attributes.resultType != ResultType.cluster
    )
      items.push(this.addAnalysisItem)

    // 实体化分析
    if (curNode.attributes.resultType == ResultType.detail) {
      items.push(this.addSTHAnalysisItem)

      // 旅馆和网吧时间轴
      if (
        curNode.attributes.resultType == ResultType.detail &&
        (curNode.attributes.represent == Represent.lg ||
          curNode.attributes.represent == Represent.wb)
      ) {
        items.push(this.addSTHTimelineItem)
      }
    }

    // 显示节点
    if (curNode.cached && curNode.cached.length > 0)
      items.push(this.addDiscoverItem)

    // 关系挖掘
    if (curNode.attributes.resultType == ResultType.node)
      items.push(this.addExpandItem)
    else if (curNode.attributes.resultType == ResultType.cluster) {
      if (
        curNode.childs &&
        curNode.childs.length > 0 &&
        curNode.hasChildNode()
      ) {
        // 节点已经被展开，就不显示该菜单了
      } else {
        items.push(this.addExpandClusterItem)
      }
    }
    // 节点操作统一管理
    items.push(this.addAddItem)

    items.push(this.addCancelItem)

    return items
  }

  this.addLayoutItem = {
    title: '布局',
    icon: [
      'M10.6,1H1.7C1.3,1,1,1.3,1,1.6v8.9c0,0.4,0.3,0.7,0.7,0.7h8.9c0.4,0,0.7-0.3,0.7-0.7V1.6    C11.3,1.3,10.9,1,10.6,1z M9.9,9.9H2.3V2.3h7.5V9.9z',
      'M22.3,1h-8.9c-0.4,0-0.7,0.3-0.7,0.7v8.9c0,0.4,0.3,0.7,0.7,0.7h8.9c0.4,0,0.7-0.3,0.7-0.7    V1.6C23,1.3,22.7,1,22.3,1z M21.7,9.9h-7.5V2.3h7.5V9.9z',
      'M10.6,12.7H1.7c-0.4,0-0.7,0.3-0.7,0.7v8.9C1,22.7,1.3,23,1.7,23h8.9c0.4,0,0.7-0.3,0.7-0.7    v-8.9C11.3,13.1,10.9,12.7,10.6,12.7z M9.9,21.7H2.3v-7.5h7.5V21.7z',
      'M22.3,12.7h-8.9c-0.4,0-0.7,0.3-0.7,0.7v8.9c0,0.4,0.3,0.7,0.7,0.7h8.9c0.4,0,0.7-0.3,0.7-0.7    v-8.9C23,13.1,22.7,12.7,22.3,12.7z M21.7,21.7h-7.5v-7.5h7.5V21.7z',
    ],
    action: function(e) {},
    submenu: ['addRectangleItem', 'addCircleItem', 'addHierarchyItem'],
  }
  this.addUnNockItem = {
    title: '解锁',
    icon: [
      'M19.9,10H6.1C5.4,7.9,6,5.6,7.5,4c2.3-2.2,6-2.3,8.3,0l1.7,1.7l1-1c0,0-1.7-1.7-1.7-1.7    C13.9,0.3,9.4,0.3,6.6,3.1C4.7,4.9,4,7.5,4.7,10C4.3,10,4,10.3,4,10.7v11.7C4,22.7,4.3,23,4.7,23h15.2c0.4,0,0.7-0.3,0.7-0.7V10.7    C20.6,10.3,20.3,10,19.9,10z M19.2,21.7H5.4V11.3h13.8V21.7z',
      'M10.8,17.2v2.2c0,0.4,0.3,0.7,0.7,0.7h1.6c0.4,0,0.7-0.3,0.7-0.7v-2.2    c0.6-0.4,0.9-1.1,0.9-1.8c0-1.3-1.1-2.4-2.4-2.4c-1.3,0-2.4,1.1-2.4,2.4C9.9,16,10.2,16.7,10.8,17.2z M12.3,14.3c0.6,0,1,0.4,1,1    c0,0.4-0.2,0.7-0.5,0.9c-0.2,0.1-0.4,0.4-0.4,0.6v1.9h-0.3v-1.9c0-0.3-0.1-0.5-0.4-0.6c-0.3-0.2-0.5-0.5-0.5-0.9    C11.3,14.8,11.7,14.3,12.3,14.3z',
    ],
    action: function(e) {
      var curNode = this.getCurrentNode()
      var arr = network.getSelectedNodes()
      arr.push(curNode.id)
      unNockNode(arr)
    },
  }
  this.addLockItem = {
    title: '锁定',
    icon: [
      'M19.4,9.9H19V8.1c0-4-3.3-7.2-7.3-7.2c-4,0-7.2,3.2-7.3,7.2v1.7H4.2c-0.4,0-0.7,0.3-0.7,0.7    v11.8c0,0.4,0.3,0.7,0.7,0.7h15.2c0.4,0,0.7-0.3,0.7-0.7V10.5C20.1,10.2,19.8,9.9,19.4,9.9z M5.9,8.2c0-3.2,2.7-5.8,5.9-5.8    c3.2,0,5.8,2.6,5.9,5.8v1.7H5.9V8.2z M18.7,21.7H4.9V11.2h0.3c0,0,0,0,0,0s0,0,0,0h13.1c0,0,0,0,0,0s0,0,0,0h0.3V21.7z',
      'M11.8,12.9c-1.3,0-2.4,1.1-2.4,2.4c0,0.7,0.3,1.4,0.9,1.9v2.2c0,0.4,0.3,0.7,0.7,0.7h1.6    c0.4,0,0.7-0.3,0.7-0.7v-2.2c0.6-0.5,0.9-1.1,0.9-1.9C14.2,13.9,13.1,12.9,11.8,12.9z M12.3,16.1c-0.2,0.1-0.4,0.4-0.4,0.6v1.9    h-0.3v-1.9c0-0.3-0.1-0.5-0.4-0.6c-0.3-0.2-0.5-0.5-0.5-0.9c0-0.6,0.5-1,1-1c0.6,0,1,0.5,1,1C12.8,15.6,12.6,16,12.3,16.1z',
    ],
    action: function(e) {
      var curNode = this.getCurrentNode()
      var arr = network.getSelectedNodes()
      arr.push(curNode.id)
      lockNode(arr)
    },
  }
  this.addFocusItem = {
    title: '聚焦',
    icon:
      'M22.4,11.7h-2.4c-0.3-3.9-3.4-7.1-7.4-7.4V1.6C12.6,1.2,12.3,1,12,1c-0.3,0-0.6,0.3-0.6,0.6   v2.7C7.4,4.6,4.3,7.7,4,11.7H1.5c-0.3,0-0.6,0.3-0.6,0.6s0.3,0.6,0.6,0.6H4c0.3,3.9,3.4,7.1,7.4,7.4v2.2c0,0.3,0.3,0.6,0.6,0.6   c0.3,0,0.6-0.3,0.6-0.6v-2.2c3.9-0.3,7.1-3.4,7.4-7.4h2.4c0.3,0,0.6-0.3,0.6-0.6S22.7,11.7,22.4,11.7z M18.7,11.7h-3.2   c-0.3-1.5-1.4-2.7-2.9-2.9V5.5C15.8,5.8,18.4,8.4,18.7,11.7z M12,14.7c-1.3,0-2.4-1.1-2.4-2.4s1.1-2.4,2.4-2.4   c1.3,0,2.4,1.1,2.4,2.4S13.3,14.7,12,14.7z M11.4,5.5v3.2C9.9,9,8.7,10.2,8.4,11.7H5.2C5.5,8.4,8.1,5.8,11.4,5.5z M5.2,12.9h3.2   c0.3,1.5,1.4,2.7,2.9,2.9V19C8.1,18.7,5.5,16.1,5.2,12.9z M12.6,19v-3.2c1.5-0.3,2.7-1.4,2.9-2.9h3.2C18.4,16.1,15.8,18.7,12.6,19z',
    action: function(e) {
      var curNode = this.getCurrentNode()
      focusNode(curNode.id, 10)
    },
  }
  //	this.addRecoverItem = {
  //			title : "恢复",
  //			icon : "M22.6,1c-0.4-0.1-0.8,0.1-1,0.4l-1.2,3.3c-2.8-3.2-7.3-4.6-11.3-3.3c-3.5,1-6.3,3.8-7.5,7.3   c-1.1,3.4-0.6,7,1.5,9.8C5,21.1,8,22.8,11.3,23c0.3,0,0.6,0,0.9,0c2.9,0,5.7-1.1,7.7-3.1c0.3-0.3,0.3-0.8,0-1c-0.3-0.3-0.8-0.3-1,0   c-1.9,1.9-4.6,2.9-7.5,2.7c-2.9-0.2-5.5-1.6-7.2-3.9C2.4,15.2,2,12.1,3,9.2c1-3.1,3.5-5.5,6.5-6.4c3.5-1,7.3,0.1,9.7,2.8l-3.5,0.1   c-0.4,0-0.7,0.3-0.7,0.8c0,0.4,0.3,0.7,0.7,0.7c0,0,0,0,0,0l4.9-0.1c0.3,0,0.6-0.2,0.7-0.5L23,2C23.1,1.6,22.9,1.1,22.6,1z",
  //			action : function(e){
  //				var curNode = this.getCurrentNode();
  //				focusNode(curNode.id,1);
  //			}
  //	};
  /**
   * 删除项
   */
  this.addDeleteItem = {
    title: '删除',
    icon: [
      'M22.3,3.5h-2.6c0,0-0.1,0-0.1,0c0,0-0.1,0-0.1,0h-3.6V1.7c0-0.4-0.3-0.7-0.7-0.7H8.8    C8.4,1,8.1,1.3,8.1,1.7v1.8H4.5c0,0-0.1,0-0.1,0c0,0-0.1,0-0.1,0H1.7C1.3,3.5,1,3.8,1,4.2s0.3,0.7,0.7,0.7h2.1l1,17.5    c0,0.4,0.3,0.6,0.7,0.6h13c0.4,0,0.7-0.3,0.7-0.7l1-17.5h2.1c0.4,0,0.7-0.3,0.7-0.7S22.7,3.5,22.3,3.5z M9.4,2.4h5.1v1.1H9.4V2.4z     M17.9,21.6H6.1l-1-16.8h13.6L17.9,21.6z',
      'M8.6,20.3C8.6,20.3,8.6,20.3,8.6,20.3c0.4,0,0.7-0.3,0.7-0.7L8.6,6.9c0-0.4-0.4-0.7-0.7-0.6    c-0.4,0-0.7,0.3-0.6,0.7l0.7,12.8C7.9,20.1,8.2,20.3,8.6,20.3z',
      'M15.3,20.3C15.4,20.3,15.4,20.3,15.3,20.3c0.4,0,0.7-0.3,0.7-0.6l0.7-12.8    c0-0.4-0.3-0.7-0.6-0.7c-0.4,0-0.7,0.3-0.7,0.6l-0.7,12.8C14.7,20,15,20.3,15.3,20.3z',
      'M12,20.3c0.4,0,0.7-0.3,0.7-0.7V6.9c0-0.4-0.3-0.7-0.7-0.7s-0.7,0.3-0.7,0.7v12.8    C11.3,20,11.6,20.3,12,20.3z',
    ],
    action: function(e) {
      var curNode = this.getCurrentNode()
      var arr = network.getSelectedNodes()

      // 如果不存在就添加
      var b = false
      for (var i in arr) {
        if (arr[i] == curNode.id) b = true
      }
      if (!b) arr.push(curNode.id)

      deleteNode(arr)
    },
  }

  /**
   * 节点操作
   */
  this.addAddItem = {
    title: '节点',
    icon:
      'M22.8,1.5C22.6,1.2,22.3,1,21.9,1c0,0,0,0,0,0C7.5,1.4,1.2,21,1,21.9c-0.1,0.3,0,0.6,0.1,0.8   c0.2,0.2,0.4,0.4,0.7,0.4h1.3c0.3,0,0.6-0.2,0.8-0.5l3.2-5.8c3.1,0.2,3.6,0,3.7-0.1c0.6-0.2,3.4-2,5.4-6.4c1.8-3.9,6.2-7.8,6.2-7.8   C22.8,2.3,22.9,1.9,22.8,1.5z M14.6,9.6c-1.9,4.2-4.4,5.4-4.3,5.4c-0.3,0.1-2.1,0-3.6-0.1c-0.3,0-0.7,0.2-0.9,0.5L5.5,16   c2.6-5,7.2-11.3,13.8-12.9C17.8,4.7,15.8,7.1,14.6,9.6z',
    action: function(e) {
      var curNode = this.getCurrentNode()
      new AddNodeWindow(curNode, e)
    },
    submenu: ['addModifyItem', 'addDeleteItem', 'addTaggingItem'],
  }

  /**
   * 修改节点
   */
  this.addModifyItem = {
    title: '修改',
    icon: [
      'M21.2,23H2.1C1.5,23,1,22.5,1,21.9V2.8c0-0.6,0.5-1.1,1.1-1.1h12.3c0.6,0,1.1,0.5,1.1,1.1   S15,3.9,14.4,3.9H3.2v16.9h16.9V8.7c0-0.6,0.5-1.1,1.1-1.1s1.1,0.5,1.1,1.1v13.2C22.3,22.5,21.8,23,21.2,23z',
      'M7.6,17.5c-0.3,0-0.6-0.1-0.8-0.3c-0.4-0.4-0.4-1.1,0-1.6L21.1,1.3c0.4-0.4,1.1-0.4,1.6,0   s0.4,1.1,0,1.6L8.4,17.2C8.2,17.4,7.9,17.5,7.6,17.5z',
    ],
    action: function(e) {
      var curNode = this.getCurrentNode()
      new ModifyNodeWindow(curNode, e)
    },
    submenu: ['addAddItem', 'addTaggingItem'],
  }

  this.addExpandItem = {
    title: '分析',
    icon: [
      'M4.6,23.1h-3c-0.4,0-0.7-0.3-0.7-0.7v-5.1c0-0.4,0.3-0.7,0.7-0.7h3c0.4,0,0.7,0.3,0.7,0.7v5.1   C5.3,22.7,5,23.1,4.6,23.1z M2.3,21.7h1.6V18H2.3V21.7z',
      'M10.5,23.1h-3c-0.4,0-0.7-0.3-0.7-0.7V8.1c0-0.4,0.3-0.7,0.7-0.7h3c0.4,0,0.7,0.3,0.7,0.7v14.3   C11.2,22.7,10.9,23.1,10.5,23.1z M8.3,21.7h1.6V8.8H8.3V21.7z',
      'M16.4,23.1h-3c-0.4,0-0.7-0.3-0.7-0.7v-9.5c0-0.4,0.3-0.7,0.7-0.7h3c0.4,0,0.7,0.3,0.7,0.7v9.5   C17.1,22.7,16.8,23.1,16.4,23.1z M14.2,21.7h1.6v-8.2h-1.6V21.7z',
      'M22.4,23.1h-3c-0.4,0-0.7-0.3-0.7-0.7V1.6c0-0.4,0.3-0.7,0.7-0.7h3c0.4,0,0.7,0.3,0.7,0.7v20.7   C23.1,22.7,22.7,23.1,22.4,23.1z M20.1,21.7h1.6V2.3h-1.6V21.7z',
    ],
    action: function(e) {},
    submenu: [
      'addTapItem',
      'addDXAnalysisItem',
      'addAnalysisOverallRelationItem',
    ],
  }

  this.addExpandClusterItem = {
    title:
      this.getCurrentNode().childs && this.getCurrentNode().childs.length > 0
        ? '展开节点'
        : '数据筛选',
    icon: [
      'M4.6,23.1h-3c-0.4,0-0.7-0.3-0.7-0.7v-5.1c0-0.4,0.3-0.7,0.7-0.7h3c0.4,0,0.7,0.3,0.7,0.7v5.1   C5.3,22.7,5,23.1,4.6,23.1z M2.3,21.7h1.6V18H2.3V21.7z',
      'M10.5,23.1h-3c-0.4,0-0.7-0.3-0.7-0.7V8.1c0-0.4,0.3-0.7,0.7-0.7h3c0.4,0,0.7,0.3,0.7,0.7v14.3   C11.2,22.7,10.9,23.1,10.5,23.1z M8.3,21.7h1.6V8.8H8.3V21.7z',
      'M16.4,23.1h-3c-0.4,0-0.7-0.3-0.7-0.7v-9.5c0-0.4,0.3-0.7,0.7-0.7h3c0.4,0,0.7,0.3,0.7,0.7v9.5   C17.1,22.7,16.8,23.1,16.4,23.1z M14.2,21.7h1.6v-8.2h-1.6V21.7z',
      'M22.4,23.1h-3c-0.4,0-0.7-0.3-0.7-0.7V1.6c0-0.4,0.3-0.7,0.7-0.7h3c0.4,0,0.7,0.3,0.7,0.7v20.7   C23.1,22.7,22.7,23.1,22.4,23.1z M20.1,21.7h1.6V2.3h-1.6V21.7z',
    ],
    action: function(e) {
      var curNode = this.getCurrentNode()
      expandNode(curNode)
    },
  }

  this.addCoverItem = {
    title: '隐藏',
    icon: [
      'M12,16.9c-6,0-10.7-4.6-10.9-4.8C1,12,1,11.9,1,11.8c0-0.1,0.1-0.3,0.1-0.4   C1.3,11.2,6.1,6.6,12,6.6c6,0,10.7,4.6,10.9,4.8c0.1,0.1,0.1,0.2,0.1,0.4c0,0.1-0.1,0.3-0.1,0.4C22.7,12.3,18,16.9,12,16.9z    M2.2,11.8C3.4,12.8,7.4,16,12,16c4.6,0,8.6-3.1,9.8-4.2c-1.2-1.1-5.2-4.2-9.8-4.2C7.4,7.6,3.4,10.7,2.2,11.8z',
      'M12,15.4c-2,0-3.6-1.6-3.6-3.6S10,8.1,12,8.1c2,0,3.6,1.6,3.6,3.6S14,15.4,12,15.4z M12,9.1   c-1.5,0-2.7,1.2-2.7,2.7c0,1.5,1.2,2.7,2.7,2.7c1.5,0,2.7-1.2,2.7-2.7C14.7,10.3,13.5,9.1,12,9.1z',
      'M6.4,17.8c-0.1,0-0.3,0-0.3-0.1c-0.2-0.2-0.2-0.5,0-0.7L17.2,5.9c0.2-0.2,0.5-0.2,0.7,0   c0.2,0.2,0.2,0.5,0,0.7L6.8,17.7C6.7,17.8,6.6,17.8,6.4,17.8z',
    ],
    action: function(e) {
      var curNode = this.getCurrentNode()
      coverNode_(curNode, false)
    },
  }

  this.addCoverChildItem = {
    title: '隐藏子',
    icon: [
      'M12,16.9c-6,0-10.7-4.6-10.9-4.8C1,12,1,11.9,1,11.8c0-0.1,0.1-0.3,0.1-0.4   C1.3,11.2,6.1,6.6,12,6.6c6,0,10.7,4.6,10.9,4.8c0.1,0.1,0.1,0.2,0.1,0.4c0,0.1-0.1,0.3-0.1,0.4C22.7,12.3,18,16.9,12,16.9z    M2.2,11.8C3.4,12.8,7.4,16,12,16c4.6,0,8.6-3.1,9.8-4.2c-1.2-1.1-5.2-4.2-9.8-4.2C7.4,7.6,3.4,10.7,2.2,11.8z',
      'M12,15.4c-2,0-3.6-1.6-3.6-3.6S10,8.1,12,8.1c2,0,3.6,1.6,3.6,3.6S14,15.4,12,15.4z M12,9.1   c-1.5,0-2.7,1.2-2.7,2.7c0,1.5,1.2,2.7,2.7,2.7c1.5,0,2.7-1.2,2.7-2.7C14.7,10.3,13.5,9.1,12,9.1z',
      'M6.4,17.8c-0.1,0-0.3,0-0.3-0.1c-0.2-0.2-0.2-0.5,0-0.7L17.2,5.9c0.2-0.2,0.5-0.2,0.7,0   c0.2,0.2,0.2,0.5,0,0.7L6.8,17.7C6.7,17.8,6.6,17.8,6.4,17.8z',
    ],
    action: function(e) {
      var curNode = this.getCurrentNode()
      coverNode_(curNode, true)
    },
  }

  this.addDiscoverItem = {
    title: '显示节点',
    icon: [
      'M12,16.5c-6,0-10.7-4.5-10.9-4.7c-0.1-0.1-0.2-0.3-0.2-0.4c0-0.2,0.1-0.3,0.2-0.4    C1.3,10.8,6,6.4,12,6.4s10.7,4.5,10.9,4.7c0.1,0.1,0.2,0.3,0.2,0.4c0,0.2-0.1,0.3-0.2,0.4C22.7,12,18,16.5,12,16.5z M2.3,11.4    c1.3,1.1,5.2,3.9,9.7,3.9c4.5,0,8.4-2.9,9.7-3.9c-1.3-1.1-5.2-3.9-9.7-3.9C7.5,7.5,3.6,10.4,2.3,11.4z',
      'M12,16.5c-2.8,0-5-2.2-5-5c0-2.8,2.2-5,5-5s5,2.2,5,5C17,14.2,14.8,16.5,12,16.5z M12,7.6    c-2.1,0-3.9,1.7-3.9,3.9s1.7,3.9,3.9,3.9s3.9-1.7,3.9-3.9S14.1,7.6,12,7.6z',
    ],
    action: function(e) {
      var curNode = this.getCurrentNode()
      discoverNode_(curNode)
    },
    submenu: ['addAddItem', 'addModifyItem', 'addTaggingItem'],
  }

  this.addAnalysisItem = {
    title: '操作',
    icon:
      'M19.9,6.2l-2.7-2.8c-0.1-0.1-0.3-0.2-0.5-0.2h-4.9V1.8c0-0.4-0.3-0.7-0.7-0.7s-0.7,0.3-0.7,0.7   v1.4H5.8c-0.4,0-0.7,0.3-0.7,0.7v2.8c0,0.4,0.3,0.7,0.7,0.7h4.5v2.3h-2c-0.4,0-0.7,0.3-0.7,0.7v12c0,0.4,0.3,0.7,0.7,0.7h5.4   c0.4,0,0.7-0.3,0.7-0.7v-12c0-0.4-0.3-0.7-0.7-0.7h-2V7.4h7.6c0.3,0,0.6-0.2,0.7-0.4C20.1,6.7,20.1,6.4,19.9,6.2z M13,21.7H9V11.2   h4V21.7z M6.5,6V4.6h9.8L17.7,6H6.5z',
    action: function(e) {},
    submenu: ['addShowPhotoItem', 'addArchiveItem', 'addTrailItem'],
  }

  this.addSTHAnalysisItem = {
    title: '分析',
    icon: [
      'M4.6,23.1h-3c-0.4,0-0.7-0.3-0.7-0.7v-5.1c0-0.4,0.3-0.7,0.7-0.7h3c0.4,0,0.7,0.3,0.7,0.7v5.1   C5.3,22.7,5,23.1,4.6,23.1z M2.3,21.7h1.6V18H2.3V21.7z',
      'M10.5,23.1h-3c-0.4,0-0.7-0.3-0.7-0.7V8.1c0-0.4,0.3-0.7,0.7-0.7h3c0.4,0,0.7,0.3,0.7,0.7v14.3   C11.2,22.7,10.9,23.1,10.5,23.1z M8.3,21.7h1.6V8.8H8.3V21.7z',
      'M16.4,23.1h-3c-0.4,0-0.7-0.3-0.7-0.7v-9.5c0-0.4,0.3-0.7,0.7-0.7h3c0.4,0,0.7,0.3,0.7,0.7v9.5   C17.1,22.7,16.8,23.1,16.4,23.1z M14.2,21.7h1.6v-8.2h-1.6V21.7z',
      'M22.4,23.1h-3c-0.4,0-0.7-0.3-0.7-0.7V1.6c0-0.4,0.3-0.7,0.7-0.7h3c0.4,0,0.7,0.3,0.7,0.7v20.7   C23.1,22.7,22.7,23.1,22.4,23.1z M20.1,21.7h1.6V2.3h-1.6V21.7z',
    ],
    action: function(e) {
      var curNode = this.getCurrentNode()
      searchPartnerByRelationObj(curNode)
    },
  }

  this.addSTHTimelineItem = {
    title: '时间轴',
    icon:
      'M22.1,6.1h-4.4c-0.5,0-0.9,0.4-0.9,0.9c0,0.5,0.4,0.9,0.9,0.9h2.2l-6.4,6.4L8,8.9   c-0.4-0.4-0.9-0.4-1.3,0l-5.5,5.5c-0.4,0.4-0.4,0.9,0,1.3C1.4,15.9,1.6,16,1.9,16s0.5-0.1,0.6-0.3l4.8-4.8l5.4,5.4   c0.2,0.2,0.4,0.3,0.6,0.3s0.5-0.1,0.6-0.3l7.1-7.1v2.3c0,0.5,0.4,0.9,0.9,0.9s0.9-0.4,0.9-0.9V7C23,6.5,22.6,6.1,22.1,6.1z',
    action: function(e) {
      if (
        $(timelneContainer)
          .parent()
          .hasClass('hidden')
      )
        $(timelneContainer)
          .parent()
          .toggleClass('hidden')
      // 显示时间轴
      var curNode = this.getCurrentNode()
      resetTimeline(curNode)
    },
  }

  this.addTaggingItem = {
    title: '一键标注',
    icon:
      'M18.7,1.5c-2.4-1-4.8-0.5-7.1,0C9.4,2,7.3,2.4,5.3,1.5c0,0,0,0,0,0c-0.1,0-0.1,0-0.2,0   c0,0,0,0,0,0c0,0-0.1,0-0.1,0c-0.1,0-0.1,0-0.2,0.1c0,0,0,0,0,0c0,0,0,0,0,0c-0.1,0-0.1,0.1-0.1,0.2c0,0,0,0,0,0.1   c0,0.1-0.1,0.2-0.1,0.3v9.1v11.1C4.3,22.7,4.6,23,5,23s0.7-0.3,0.7-0.7V12.2c0.7,0.2,1.5,0.3,2.2,0.3c1.4,0,2.7-0.3,4-0.5   c2.2-0.4,4.3-0.9,6.3,0c0.2,0.1,0.4,0.1,0.6-0.1c0.2-0.1,0.3-0.3,0.3-0.6V2.2C19.2,1.9,19,1.6,18.7,1.5z M17.8,10.4   c-2.1-0.6-4.2-0.1-6.2,0.3c-2.1,0.4-4,0.8-5.9,0.2V3.1c2.1,0.6,4.2,0.1,6.2-0.3c2.1-0.4,4-0.8,5.9-0.2V10.4z',
    action: function(e) {
      var curNode = this.getCurrentNode()
      curNode.taggingState()
    },
    submenu: ['addAddItem', 'addModifyItem', 'addTaggingItem'],
  }

  /**
   * 取消
   */
  this.addCancelItem = {
    title: '取消',
    icon:
      'M13.4,12l9.3-9.3c0.4-0.4,0.4-1,0-1.4s-1-0.4-1.4,0L12,10.6L2.7,1.3c-0.4-0.4-1-0.4-1.4,0   s-0.4,1,0,1.4l9.3,9.3l-9.3,9.3c-0.4,0.4-0.4,1,0,1.4C1.5,22.9,1.7,23,2,23s0.5-0.1,0.7-0.3l9.3-9.3l9.3,9.3   c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3c0.4-0.4,0.4-1,0-1.4L13.4,12z',
    action: function(e) {
      removeSVGContextMenu()
    },
  }

  this.init()
}
